package by.dvrudenko.avtobaza.services;

import java.util.List;

import javax.persistence.metamodel.SingularAttribute;

import org.springframework.transaction.annotation.Transactional;

import by.dvrudenko.avtobaza.datamodel.Driver;
import by.dvrudenko.avtobaza.datamodel.Route;
import by.dvrudenko.avtobaza.datamodel.enums.OrderStatus;

public interface RouteService {
	
	Route get(Long id);
	
	Long getCount(Long id);
	
	@Transactional
	void saveOrUpdate(Route route);

	@Transactional
	void delete(Route route);

	@Transactional
	void deleteAll();
	
	@Transactional
	void changeRouteStatusByOrderId(Long id);
	
	@Transactional
	void sendDriverToRoute(Route route);
	
	Route getRouteByUserOrder(Long id) ;
	
	Integer getAcomplishRoutesByDriverId(Long id);
	
	Route getSingleRouteById(Long id);
	
	List<Route> getAllRoute();
	
	List<Route> getAllRouteActive(Boolean active);
	
	List<Route> getAllActiveRouteByStatus(OrderStatus orderStatus);
	
    List<Route> getAllRoute(SingularAttribute<Route, ?> attr, boolean ascending,
    		int startRecord, int pageSize, Long DriverId);	
	
	Route getRandomActiveRoute();
	
}
